<!DOCTYPE html>
<html lang="zh-cn">
   <head>
      <meta charset="utf-8">
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <title>{$CONF['mallTitle']}后台管理中心</title>
      <link href="__PUBLIC__/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
     <link href="__CSS__/AdminLTE.css" rel="stylesheet" type="text/css" />
      <!--[if lt IE 9]>
      <script src="__PUBLIC__/js/html5shiv.min.js"></script>
      <script src="__PUBLIC__/js/respond.min.js"></script>
      <![endif]-->
      <script src="__PUBLIC__/js/jquery.min.js"></script>
      <script src="__PUBLIC__/plugins/bootstrap/js/bootstrap.min.js"></script>
      <script src="__PUBLIC__/plugins/formValidator/formValidator-4.1.3.js"></script>
      <script src="__PUBLIC__/js/common.js"></script>
      <script src="__PUBLIC__/plugins/plugins/plugins.js"></script>
   </head>
   <script>
   $(function () {
     $.formValidator.initConfig({
       theme:'Default',mode:'AutoTip',formID:"myform",debug:true,submitOnce:true,onSuccess:function(){
           edit();
             return false;
      },onError:function(msg){
    }});
     $("#expressCompany").formValidator({onShow:"",onFocus:"",onCorrect:"输入正确"}).inputValidator({min:2,onError:"物流名称不能少于2个字符"});
     $("#pinyin").formValidator({onShow:"",onFocus:"",onCorrect:"输入正确"}).inputValidator({min:2,onError:"物流名称不能少于2个字符"});
     $("#telephone").formValidator({onShow:"",onFocus:"",onCorrect:"输入正确"}).inputValidator({min:4,onError:"查询电话不能少于4个字符"});
     $("#website").formValidator({onShow:"",onFocus:"",onCorrect:"输入正确"}).inputValidator({min:8,onError:"官方网址不能少于8个字符"});

   });
   function edit(){
     var params = {};
     params.id = $('#id').val();
     params.expressCompany = $('#expressCompany').val();
     params.pinyin = $('#pinyin').val();
     params.isShow = $('input[name="isShow"]:checked').val();
     params.isEnable = $('input[name="isEnable"]:checked').val();;
     params.telephone = $('#telephone').val();
     params.website = $('#website').val();
     Plugins.waitTips({title:'信息提示',content:'正在提交数据，请稍后...'});
     $.post("{:U('Admin/Express/edit')}",params,function(data,textStatus){
      var json = WST.toJson(data);
      if(json.status=='1'){
        Plugins.setWaitTipsMsg({ content:'操作成功',timeout:1000,callback:function(){
           location.href='{:U("Admin/Express/index")}';
        }});
      }else{
        Plugins.closeWindow();
        Plugins.Tips({title:'信息提示',icon:'error',content:'操作失败!',timeout:1000});
      }
     });
   }
   
   </script>
   <body class="wst-page">
       <form name="myform" method="post" id="myform" autocomplete="off">
        <input type='hidden' id='id' value='{$object.id}'/>
        <table class="table table-hover table-striped table-bordered wst-form">
           <tr>
             <th width='120' align='right'>物流名称<font color='red'>*</font>：</th>
             <td><input type='text' id='expressCompany' class="form-control wst-ipt" value='{$object.expressCompany}' maxLength='25'/></td>
           </tr>
           <tr>
             <th width='120' align='right'>物流拼音<font color='red'>*</font>：</th>
             <td><input type='text' id='pinyin' class="form-control wst-ipt" value='{$object.pinyin}' maxLength='25'/></td>
           </tr>
           <tr>
             <th width='120' align='right'>查询电话<font color='red'>*</font>：</th>
             <td><input type='text' id='telephone' class="form-control wst-ipt" value='{$object.telephone}' maxLength='25'/></td>
           </tr>
           <tr>
             <th width='120' align='right'>官方网址<font color='red'>*</font>：</th>
             <td><input type='text' id='website' class="form-control wst-ipt" value='{$object.website}' maxLength='25'/></td>
           </tr>
           <tr>
             <th align='right'>显示状态<font color='red'>*</font>：</th>
             <td>
             <label>
             <input type='radio' id='isEnable' value='1' name='isEnable' <if condition="$object['isEnable'] ==1 ">checked</if>/>显示
             </label>
             <label>
             <input type='radio' id='isEnable' value='0' name='isEnable' <if condition="$object['isEnable'] ==0 ">checked</if>/>隐藏
             </label>
             </td>
           </tr>
           <tr>
             <th align='right'>启用状态<font color='red'>*</font>：</th>
             <td>
             <label>
             <input type='radio' id='isShow1' value='1' name='isShow' <if condition="$object['isShow'] ==1 ">checked</if>/>启用
             </label>
             <label>
             <input type='radio' id='isShow0' value='0' name='isShow' <if condition="$object['isShow'] ==0 ">checked</if>/>禁用
             </label>
             </td>
           </tr>
           <tr>
             <td colspan='2' style='padding-left:250px;'>
                 <button type="submit" class="btn btn-success">保&nbsp;存</button>
                  <a class="btn btn-primary" href='{:U("Admin/Express/index")}'>返&nbsp;回</button>
             </td>
           </tr>
        </table>
       </form>
   </body>
</html>